package com.cium.aqie.branch

import com.cium.aqie.myClass.MyIntList

/**
 * @Function:
 * @Author: aqie
 * @Date: 2019/8/29 16:53
 */
fun main(args: Array<String>) {
    // 整形数组
    val arrayOfInt = intArrayOf(1,3,5,7)
    for (i in arrayOfInt) print(i)

    // 字符串数组
    val stringArray = arrayOf("a", "b", "c")
    for ((index, value) in stringArray.withIndex()){
        print("\t $index => $value")
    }
    println()

    for(indexedValue in stringArray.withIndex()){
        print("\t${indexedValue.index} -> ${indexedValue.value}")
    }

    println()
    // list
    val list = MyIntList()
    list.add(1)
    list.add(2)
    list.add(3)
    for (i in list) print(i)

    // while 循环
    var x = 5
    while(x > 0){
        println(x)
        x--
    }

    do{
        println(x)
        x--
    }while (x > 0)


}